package com.fang.modules.web01.controller;

import com.fang.modules.server.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * @Description
 * @Author Bernie_fang
 * @Date 2022/12/4 23:00
 **/
@RestController
public class HelloWeb01Controller {

    @Autowired
    private HelloService service;

    @GetMapping(value = "helloWeb01")
    public String hello() {
        return "hello web 01";
    }


    @GetMapping(value = "callHelloService01")
    public String helloService() {
        return service.helloService("01");
    }

    @GetMapping(value = "testAspect1")
    public String testAspect1() {
        return "success, testAspect1";
    }

    @GetMapping(value = "testAspect2")
    public String testAspect2(@RequestParam String name) {
        return "success, testAspect2, param -> " + name;
    }

    @GetMapping(value = "testAspect3")
    public String testAspect3(@RequestParam String name, @RequestParam String age) {
        return "success, testAspect3, param -> " + name + ", param2 -> " + age;
    }

}
